#include "CentralWidget.h"

CentralWidget::CentralWidget( QWidget* parent )
	: QSplitter( Qt::Vertical, parent )
{
	QToolBar* toolBar = new QToolBar( this );
	toolBar->setOrientation( Qt::Horizontal );
	addWidget( toolBar );

	QAction* submitAction = toolBar->addAction( "Submit" );
	connect( submitAction, SIGNAL( triggered() ), this, SLOT( submit() ) );
	QAction* revertAction = toolBar->addAction( "Revert" );
	connect( revertAction, SIGNAL( triggered() ), this, SLOT( revert() ) );

	mNavagator = new Navagator( this );
	addWidget( mNavagator );
}

CentralWidget::~CentralWidget()
{
}

void
CentralWidget::submit()
{
	Database::instance()->submit();
}

void
CentralWidget::revert()
{
	Database::instance()->revert();
}